<template>
    <div class="bg-white fixed w-screen">
        
        <LoadingPage v-if="auth_loading"/>
        
        <div v-else>
            <NuxtPage></NuxtPage>
        </div>
    </div>
</template>


<script setup>

const { useAuthLoading, initAuth } = useAuth()
const auth_loading = useAuthLoading()


onBeforeMount(async() => {
    const res = await useFetch('/config.json')
    setTimeout(() => {
        const config = res.data.value
        const server_config = config.server[config.env]
        useState('server_config').value = {
            ip: server_config.ip,
            port: server_config.port
        }
        initAuth()
    }, 1000)
    
})



</script>